home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_319
/
cnewssrc
/
cnews.orig.lzh
/
man
/
subst.man
< prev
Wrap
Text File
|
1989-06-28
|
3KB
|
133 lines
SSSSUUUUBBBBSSSSTTTT((((1111)))) XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((llllooooccccaaaallll)))) SSSSUUUUBBBBSSSSTTTT((((1111))))
NNNNAAAAMMMMEEEE
subst - substitute definitions into file(s)
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ssssuuuubbbbsssstttt ----ffff substitutions victim ...
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_S_u_b_s_t makes substitutions into files, in a way that is
suitable for customizing software to local conditions. Each
_v_i_c_t_i_m file is altered according to the contents of the
_s_u_b_s_t_i_t_u_t_i_o_n_s file.
The _s_u_b_s_t_i_t_u_t_i_o_n_s file contains one line per substitution.
A line consists of two fields separated by one or more tabs.
The first field is the _n_a_m_e of the substitution, the second
is the _v_a_l_u_e. Neither should contain the character `#'. A
line starting with `#' is a comment and is ignored.
In the _v_i_c_t_i_ms, each line on which a substitution is to be
made (a _t_a_r_g_e_t line) must be preceded by a _p_r_o_t_o_t_y_p_e line.
The prototype line should be delimited in such a way that it
will be taken as a comment by whatever program processes the
file later. The prototype line must contain a ``prototype''
of the target line bracketed by `=()<' and `>()=';
everything else on the prototype line is ignored. _S_u_b_s_t
extracts the prototype, changes all instances of
substitution names bracketed by `@<' and `>@' to their
values, and then replaces the target line with the result.
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
If the _s_u_b_s_t_i_t_u_t_i_o_n_s file is
FIRST 111
SECOND 222
and the _v_i_c_t_i_m file is
x = 2;
/* =()<y = @<FIRST>@ + @<SECOND>@;>()= */
y = 88 + 99;
z = 5;
then ``ssssuuuubbbbsssstttt ----ffff _s_u_b_s_t_i_t_u_t_i_o_n_s _v_i_c_t_i_m'' changes _v_i_c_t_i_m to:
x = 2;
/* =()<y = @<FIRST>@ + @<SECOND>@;>()= */
y = 111 + 222;
z = 5;
FFFFIIIILLLLEEEESSSS
n._v_i_c_t_i_m new version being built
o._v_i_c_t_i_m old version during renaming
Page 1 (printed 6/29/89)
SSSSUUUUBBBBSSSSTTTT((((1111)))) XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((llllooooccccaaaallll)))) SSSSUUUUBBBBSSSSTTTT((((1111))))
SSSSEEEEEEEE AAAALLLLSSSSOOOO
sed(1)
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
Complains and halts if it is unable to create its temporary
files or if they already exist.
HHHHIIIISSSSTTTTOOOORRRRYYYY
Written at U of Toronto by Henry Spencer.
BBBBUUUUGGGGSSSS
When creating a file to be _s_u_b_s_ted, it's easy to forget to
insert a dummy target line after a prototype line; if you
forget, _s_u_b_s_t ends up deleting whichever line did in fact
follow the prototype line.
Page 2 (printed 6/29/89)